package com.woniuxy.intellihome.utils;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000117678968";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCBNXLaP7Hpv6EpMb3RfF7bPMxiyH6VR7dG8ZDx9ut3ffElGlR8vcwF+f3oWd65tG+AVmR5xTBHfW+yOYNMfo1OEUFJdVan1NDypDJlUprNxS/zMOCVoeh5dR3ZtL1MCwvjsUicKfSNuTklUPLUV0tMD9enNkdimfj0yhEGnn7j9SuoaK961T9XgAgaMA/9PvENz/gxAJ+tW1cWEe56dliTgWXoYbHk2zAqS8fi0DShGlVKnXAXnn0uI24gxBYG9R1AQUeADAPt9ZIxUd3pOz57wfsijiIfodb0B3mTpaF3ZC/zOHxNpuNVftr/BugHTfMu47dD5uGsKkRr9ruyTwQJAgMBAAECggEAMJkz69cNSggjy+TDqqmG3BtQHM+gnPFuhCaUCA6Bnl4md3gh0xFoTc8rq1syJNMzJShZflumvxz1CCoNspXe/EANOF4EC/hF5x3PPsEFLORAFs6Jin5tfFGKurn6gUGeZTPnRaWaMDw8vEZoL2nuDlvfFyuZSgLz2s6t/LlcrMyahYlyqukLLXig0eGDHlSv2MG6SQpoPmJVDTbUvqq1/DXRt7l5jPSo3eZmYgLbIzG4RGDlgDBHo30s8OI9lv4+FY06i11YizyUDd9TVK9cxqckloA4rYH73GtL7YoZqq5/oG57FdjqWwmw7kwiSCseC+93ma6plTpxmzs69v7WyQKBgQDuzrASMLOYv5DTL3kRAhbtYg8RSqNabzWRrCNSdJPirld6QfS9DswXUfiq4OXNScDxpLApxFeQUsxQuMH939p5DIyt8m7owlKMbKDQ3yNjIeTmzmiu2PPYL4nFsi0VoSno4FiKwWIRurS358Qx1jU7/otW3hAVD2SnrB5nuOfUrwKBgQCKgtEEmYqK1p9m/W0FVqynntv56v0xNiUSIAKSFDjcOSmxWeoWUHAzzLit9mqhb8RIBaBnPFkvPh4i2P0wAW120ecnqSgq400fNTai2+mbG1gne6op1VjssVle9gie5XNvhovTrRYvrRFBr7UHMdm8fsfhBPYbxWDoJpbl4v5QxwKBgQCcJ18OpfXqPemPjo1Vx84CL4q2vd2PNwUKWktGkaBaK7Jb6WEFdvWRkjJOWn0p/b5CxHPE+/ReFSYw6n8/aO9NFB2xaMOJQ/gChs2phx92pSUun23oV0kr5fnq4hWE/TuQYZLEOKvN+A5P6ydphy6MKmgmx1Iw0z34Ph4rqMc/VQKBgEpHwWQgG2Y9lxqaSf8U7l6uGPY8CTB9AwBnXjmM0rl3hl5wA9OXq7R704anoaOV1sNxEQaMHJ/zRiIWECHQgi24f6iLVNk7ML7NwNEx8mOWFH6IGUd5/Mhii7UbaKAeGPv0QcRxDHbg72I0onaLS2OE8hhAmuNlxIR7PW1ngE89AoGBALrPbwWXHbX5r96JJJw5C51r4/N052Xhe6y7zF+QYidBdGGWakvioYhFL3uXm7kFPr+q8kSwZhcfhNVaOt+oOsD0MtK0sWMaZqa0SRQ6pKIOknNnKPCbH8IcA5fehjrOlBdSR6KHdz/4dxigQVcdVlmWxkeDQ9A8dajDJKQmZ5eL";
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApdsPMWDTfjQA8hrvn8iIggg3fTCSW8aIXcNCT0H+Sb57KFAmZOcN+WqcZyKKGsZsS871+OtfR3x63OEXf12AJZDzoCG9Ww6XXl3RP7LC10K0IW3cFHtJlrK8V7/cL5nz37WnLVg8+z2g9fVo4+At3QcOjr46Z+Omx3lIhQiOdh/x2zRbW/KKxkdSRbu61QEb+reXeBwCmCXwr30rH+8useUy+tHSNgUZ89jjWGe27mIEpwJ1zyMAK51G3Ni1ZFHWq3yEtdYLjnu932NDEQc6uyAAqdYwb0EpBs0uwtP4uLPf6c2PdWs8vXloVuVQGpPKkCJcJFPnikYxPCQb8zT9JwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/front/alipay/notify";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/front/alipay/return";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }


}

